<?php
session_start();
include 'header.php';?>
    <div class="container_12 primary_content_wrap clearfix">
        <div class="clearfix">
            <div class="top-content">
                <div class="grid_12">
                    <div class="widget-main" id="my_poststypewidget-3">
                        <center>
                            <div class="extra-wrap">
                                <h3>Thông tin đơn hàng</h3>
                            </div>
                            <div class="extra-wrap">
                                <style>
                                    table, th, td {
                                        border: 1px solid black;
                                        border-collapse: collapse;
                                        padding: 5px;
                                    }
                                </style>
                                <form method="post" action="index.php">
                                    <table style="text-align: left;color: #000000">
                                        <tbody>
                                        <tr>
                                            <td>Họ và tên:</td>
                                            <td><?php echo $_POST['name'] ?></td>
                                        </tr>
                                        <tr>
                                            <td>Điện thoại:</td>
                                            <td><?php echo $_POST['tel'] ?></td>
                                        </tr>
                                        <tr>
                                            <td>Email:</td>
                                            <td><?php echo $_POST['email'] ?></td>
                                        </tr>
                                        <tr>
                                            <td>Địa chỉ:</td>
                                            <td><?php echo $_POST['address'] ?></td>
                                        </tr>
                                        <tr>
                                            <td>Yêu cầu:</td>
                                            <td><?php echo $_POST['requirement'] ?></td>
                                        </tr>

                                        <tr>
                                            <td colspan="2"><b>Sản phẩm:</b></td>
                                        </tr>

                                        <?php
                                        if (!empty($_SESSION['cart'])) {
                                            foreach ($_SESSION['cart'] as $k => $v) {
                                                ?>
                                                <tr>
                                                    <td>Mã sản phẩm:</td>
                                                    <td><?php echo $k; ?></td>
                                                </tr>
                                                <tr>
                                                    <td>Tên sản phẩm:</td>
                                                    <td><?php echo $v['name']; ?></td>
                                                </tr>
                                                <tr>
                                                    <td>Đơn giá:</td>
                                                    <td><?php echo $v['price']; ?> VND</td>
                                                </tr>
                                                <tr>
                                                    <td>Số lượng:</td>
                                                    <td><?php echo $v['qty']; ?></td>
                                                </tr>

                                                <?php $total += ($v['price'] * $v['qty']);
                                                ?>
                                            <?php
                                            }
                                        }
                                        ?>
                                        <tr>
                                            <td><b>Tổng tiền:</b></td>
                                            <td><b><?php echo $total ; session_destroy();?> VND</b></td>
                                        </tr>

                                        </tbody>
                                    </table>
                                    <br>
                                    <input type="submit" value="Kết thúc"/>
                                </form>
                            </div>
                        </center>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </div>
<?php
include 'footer.php';?>